import router from '@system.router'
import storage from '@system.storage'
import fetch from '@system.fetch'
import md5 from "/src/global/md5.js";
import prompt from '@system.prompt'
import device from '@system.device'
async function getUserInfo(){
    let url = 'api/kyy_user/info';
    return await $xt.rfetch(url);
}

async function userSign(coins){
    let url = 'api/kyy_user/sign';
    return await $xt.rfetch(url,{coins});
}

async function lottery(coins){
  let url = 'api/kyy_user/lottery';
  return await $xt.rfetch(url,{coins});
}

async function getOpenBoxCoins(type){
  let url = 'api/kyy_user/openBox';
  return await $xt.rfetch(url,{type:type});
}

async function giveVideoReward(reward_id,box_times,type){
  console.log(reward_id,box_times);
  let url = 'api/kyy_user/giveReward';
  return await $xt.rfetch(url,{reward_id,box_times,type});
}

async function getVideoReward(type){
  let url = 'api/kyy_user/rewardInfo';
  return await $xt.rfetch(url);
}

async function transcationList(page){
  let url = 'api/kyy_user/transcationList';
  return await $xt.rfetch(url,{page});
}
async function moneyList(page){
  let url = 'api/kyy_user/transcationMoneyList';
  return await $xt.rfetch(url,{page});
}

async function withdrawalLevel(){
  let url = 'api/kyy_user/withdrawalLevel';
  return await $xt.rfetch(url);
}


// 给金币
export default {
  getUserInfo,userSign,getOpenBoxCoins,giveVideoReward,getVideoReward,lottery,transcationList,withdrawalLevel,moneyList
}
